export const showInfo = (geocoder:any, map:any, AMap:any,e: any, x: any, y: any) => {
  geocoder.getAddress(e.lnglat,(status: any, result: any) => {
    if (status === 'complete' && result.regeocode) {
      const address = result.regeocode.formattedAddress
      // 如果信息窗体有图片的话，需要注意下写法
      const infoContent = `
        <div style="padding:7px 0px 0px 0px;">
          <div class="global-header">当前位置</div>
          <p class='input-item'>经度: ${x}</p>
          <p class='input-item'>纬度: ${y}</p>
          <p class='input-item'>地址: ${address}</p>
        </div>
      `
      const infoWindow = new AMap.InfoWindow({
        content: infoContent
      })
      infoWindow.open(map, new AMap.LngLat(x, y))
    } else {
      console.error('获取地址失败')
    }
  })
}